

<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="./">
<head>
  <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>pymatgen.analysis.chemenv.utils package &mdash; pymatgen 2025.6.14 documentation</title>
      <link rel="stylesheet" type="text/css" href="assets/pygments.css?v=03e43079" />
      <link rel="stylesheet" type="text/css" href="assets/css/theme.css?v=e59714d7" />
      <link rel="stylesheet" type="text/css" href="assets/css/custom.css" />

  
    <link rel="canonical" href="https://pymatgen.orgpymatgen.analysis.chemenv.utils.html"/>
      <script src="assets/jquery.js?v=5d32c60e"></script>
      <script src="assets/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
      <script src="assets/documentation_options.js?v=03bec786"></script>
      <script src="assets/doctools.js?v=9bcbadda"></script>
      <script src="assets/sphinx_highlight.js?v=dc90522c"></script>
    <script src="assets/js/theme.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" /> 
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: linear-gradient(0deg, rgba(23,63,162,1) 0%, rgba(0,70,192,1) 100%)" >

          
          
          <a href="index.html">
            
          </a>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <!-- Local TOC -->
              <div class="local-toc"><ul>
<li><a class="reference internal" href="#">pymatgen.analysis.chemenv.utils package</a><ul>
<li><a class="reference internal" href="#submodules">Submodules</a></li>
<li><a class="reference internal" href="#module-pymatgen.analysis.chemenv.utils.chemenv_config">pymatgen.analysis.chemenv.utils.chemenv_config module</a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.chemenv_config.ChemEnvConfig"><code class="docutils literal notranslate"><span class="pre">ChemEnvConfig</span></code></a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.chemenv_config.ChemEnvConfig.DEFAULT_PACKAGE_OPTIONS"><code class="docutils literal notranslate"><span class="pre">ChemEnvConfig.DEFAULT_PACKAGE_OPTIONS</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.chemenv_config.ChemEnvConfig.auto_load"><code class="docutils literal notranslate"><span class="pre">ChemEnvConfig.auto_load()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.chemenv_config.ChemEnvConfig.has_materials_project_access"><code class="docutils literal notranslate"><span class="pre">ChemEnvConfig.has_materials_project_access</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.chemenv_config.ChemEnvConfig.package_options_description"><code class="docutils literal notranslate"><span class="pre">ChemEnvConfig.package_options_description()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.chemenv_config.ChemEnvConfig.save"><code class="docutils literal notranslate"><span class="pre">ChemEnvConfig.save()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.chemenv_config.ChemEnvConfig.setup"><code class="docutils literal notranslate"><span class="pre">ChemEnvConfig.setup()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.chemenv_config.ChemEnvConfig.setup_package_options"><code class="docutils literal notranslate"><span class="pre">ChemEnvConfig.setup_package_options()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#module-pymatgen.analysis.chemenv.utils.chemenv_errors">pymatgen.analysis.chemenv.utils.chemenv_errors module</a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.chemenv_errors.AbstractChemenvError"><code class="docutils literal notranslate"><span class="pre">AbstractChemenvError</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.chemenv_errors.ChemenvError"><code class="docutils literal notranslate"><span class="pre">ChemenvError</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.chemenv_errors.EquivalentSiteSearchError"><code class="docutils literal notranslate"><span class="pre">EquivalentSiteSearchError</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.chemenv_errors.NeighborsNotComputedChemenvError"><code class="docutils literal notranslate"><span class="pre">NeighborsNotComputedChemenvError</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.chemenv_errors.SolidAngleError"><code class="docutils literal notranslate"><span class="pre">SolidAngleError</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#module-pymatgen.analysis.chemenv.utils.coordination_geometry_utils">pymatgen.analysis.chemenv.utils.coordination_geometry_utils module</a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane"><code class="docutils literal notranslate"><span class="pre">Plane</span></code></a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.TEST_2D_POINTS"><code class="docutils literal notranslate"><span class="pre">Plane.TEST_2D_POINTS</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.a"><code class="docutils literal notranslate"><span class="pre">Plane.a</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.abcd"><code class="docutils literal notranslate"><span class="pre">Plane.abcd</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.b"><code class="docutils literal notranslate"><span class="pre">Plane.b</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.c"><code class="docutils literal notranslate"><span class="pre">Plane.c</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.coefficients"><code class="docutils literal notranslate"><span class="pre">Plane.coefficients</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.crosses_origin"><code class="docutils literal notranslate"><span class="pre">Plane.crosses_origin</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.d"><code class="docutils literal notranslate"><span class="pre">Plane.d</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.distance_to_origin"><code class="docutils literal notranslate"><span class="pre">Plane.distance_to_origin</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.distance_to_point"><code class="docutils literal notranslate"><span class="pre">Plane.distance_to_point()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.distances"><code class="docutils literal notranslate"><span class="pre">Plane.distances()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.distances_indices_groups"><code class="docutils literal notranslate"><span class="pre">Plane.distances_indices_groups()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.distances_indices_sorted"><code class="docutils literal notranslate"><span class="pre">Plane.distances_indices_sorted()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.fit_error"><code class="docutils literal notranslate"><span class="pre">Plane.fit_error()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.fit_least_square_distance_error"><code class="docutils literal notranslate"><span class="pre">Plane.fit_least_square_distance_error()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.fit_maximum_distance_error"><code class="docutils literal notranslate"><span class="pre">Plane.fit_maximum_distance_error()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.from_2points_and_origin"><code class="docutils literal notranslate"><span class="pre">Plane.from_2points_and_origin()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.from_3points"><code class="docutils literal notranslate"><span class="pre">Plane.from_3points()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.from_coefficients"><code class="docutils literal notranslate"><span class="pre">Plane.from_coefficients()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.from_npoints"><code class="docutils literal notranslate"><span class="pre">Plane.from_npoints()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.from_npoints_least_square_distance"><code class="docutils literal notranslate"><span class="pre">Plane.from_npoints_least_square_distance()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.from_npoints_maximum_distance"><code class="docutils literal notranslate"><span class="pre">Plane.from_npoints_maximum_distance()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.indices_separate"><code class="docutils literal notranslate"><span class="pre">Plane.indices_separate()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.init_3points"><code class="docutils literal notranslate"><span class="pre">Plane.init_3points()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.is_in_list"><code class="docutils literal notranslate"><span class="pre">Plane.is_in_list()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.is_in_plane"><code class="docutils literal notranslate"><span class="pre">Plane.is_in_plane()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.is_same_plane_as"><code class="docutils literal notranslate"><span class="pre">Plane.is_same_plane_as()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.orthonormal_vectors"><code class="docutils literal notranslate"><span class="pre">Plane.orthonormal_vectors()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.perpendicular_bisector"><code class="docutils literal notranslate"><span class="pre">Plane.perpendicular_bisector()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.project_and_to2dim"><code class="docutils literal notranslate"><span class="pre">Plane.project_and_to2dim()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.project_and_to2dim_ordered_indices"><code class="docutils literal notranslate"><span class="pre">Plane.project_and_to2dim_ordered_indices()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.projectionpoints"><code class="docutils literal notranslate"><span class="pre">Plane.projectionpoints()</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.anticlockwise_sort"><code class="docutils literal notranslate"><span class="pre">anticlockwise_sort()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.anticlockwise_sort_indices"><code class="docutils literal notranslate"><span class="pre">anticlockwise_sort_indices()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.changebasis"><code class="docutils literal notranslate"><span class="pre">changebasis()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.collinear"><code class="docutils literal notranslate"><span class="pre">collinear()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.diamond_functions"><code class="docutils literal notranslate"><span class="pre">diamond_functions()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.function_comparison"><code class="docutils literal notranslate"><span class="pre">function_comparison()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.get_lower_and_upper_f"><code class="docutils literal notranslate"><span class="pre">get_lower_and_upper_f()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.is_anion_cation_bond"><code class="docutils literal notranslate"><span class="pre">is_anion_cation_bond()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.matrixTimesVector"><code class="docutils literal notranslate"><span class="pre">matrixTimesVector()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.quarter_ellipsis_functions"><code class="docutils literal notranslate"><span class="pre">quarter_ellipsis_functions()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.rectangle_surface_intersection"><code class="docutils literal notranslate"><span class="pre">rectangle_surface_intersection()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.rotateCoords"><code class="docutils literal notranslate"><span class="pre">rotateCoords()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.rotateCoordsOpt"><code class="docutils literal notranslate"><span class="pre">rotateCoordsOpt()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.separation_in_list"><code class="docutils literal notranslate"><span class="pre">separation_in_list()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.solid_angle"><code class="docutils literal notranslate"><span class="pre">solid_angle()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.sort_separation"><code class="docutils literal notranslate"><span class="pre">sort_separation()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.sort_separation_tuple"><code class="docutils literal notranslate"><span class="pre">sort_separation_tuple()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.spline_functions"><code class="docutils literal notranslate"><span class="pre">spline_functions()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.vectorsToMatrix"><code class="docutils literal notranslate"><span class="pre">vectorsToMatrix()</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#module-pymatgen.analysis.chemenv.utils.defs_utils">pymatgen.analysis.chemenv.utils.defs_utils module</a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions"><code class="docutils literal notranslate"><span class="pre">AdditionalConditions</span></code></a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.ALL"><code class="docutils literal notranslate"><span class="pre">AdditionalConditions.ALL</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.CONDITION_DESCRIPTION"><code class="docutils literal notranslate"><span class="pre">AdditionalConditions.CONDITION_DESCRIPTION</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.NONE"><code class="docutils literal notranslate"><span class="pre">AdditionalConditions.NONE</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.NO_AC"><code class="docutils literal notranslate"><span class="pre">AdditionalConditions.NO_AC</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.NO_ADDITIONAL_CONDITION"><code class="docutils literal notranslate"><span class="pre">AdditionalConditions.NO_ADDITIONAL_CONDITION</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.NO_E2SEB"><code class="docutils literal notranslate"><span class="pre">AdditionalConditions.NO_E2SEB</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.NO_ELEMENT_TO_SAME_ELEMENT_BONDS"><code class="docutils literal notranslate"><span class="pre">AdditionalConditions.NO_ELEMENT_TO_SAME_ELEMENT_BONDS</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.ONLY_ACB"><code class="docutils literal notranslate"><span class="pre">AdditionalConditions.ONLY_ACB</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.ONLY_ACB_AND_NO_E2SEB"><code class="docutils literal notranslate"><span class="pre">AdditionalConditions.ONLY_ACB_AND_NO_E2SEB</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.ONLY_ANION_CATION_BONDS"><code class="docutils literal notranslate"><span class="pre">AdditionalConditions.ONLY_ANION_CATION_BONDS</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.ONLY_ANION_CATION_BONDS_AND_NO_ELEMENT_TO_SAME_ELEMENT_BONDS"><code class="docutils literal notranslate"><span class="pre">AdditionalConditions.ONLY_ANION_CATION_BONDS_AND_NO_ELEMENT_TO_SAME_ELEMENT_BONDS</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.ONLY_E2OB"><code class="docutils literal notranslate"><span class="pre">AdditionalConditions.ONLY_E2OB</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.ONLY_ELEMENT_TO_OXYGEN_BONDS"><code class="docutils literal notranslate"><span class="pre">AdditionalConditions.ONLY_ELEMENT_TO_OXYGEN_BONDS</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.check_condition"><code class="docutils literal notranslate"><span class="pre">AdditionalConditions.check_condition()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#module-pymatgen.analysis.chemenv.utils.func_utils">pymatgen.analysis.chemenv.utils.func_utils module</a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.AbstractRatioFunction"><code class="docutils literal notranslate"><span class="pre">AbstractRatioFunction</span></code></a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.AbstractRatioFunction.ALLOWED_FUNCTIONS"><code class="docutils literal notranslate"><span class="pre">AbstractRatioFunction.ALLOWED_FUNCTIONS</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.AbstractRatioFunction.evaluate"><code class="docutils literal notranslate"><span class="pre">AbstractRatioFunction.evaluate()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.AbstractRatioFunction.from_dict"><code class="docutils literal notranslate"><span class="pre">AbstractRatioFunction.from_dict()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.AbstractRatioFunction.setup_parameters"><code class="docutils literal notranslate"><span class="pre">AbstractRatioFunction.setup_parameters()</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMFiniteRatioFunction"><code class="docutils literal notranslate"><span class="pre">CSMFiniteRatioFunction</span></code></a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMFiniteRatioFunction.ALLOWED_FUNCTIONS"><code class="docutils literal notranslate"><span class="pre">CSMFiniteRatioFunction.ALLOWED_FUNCTIONS</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMFiniteRatioFunction.fractions"><code class="docutils literal notranslate"><span class="pre">CSMFiniteRatioFunction.fractions()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMFiniteRatioFunction.mean_estimator"><code class="docutils literal notranslate"><span class="pre">CSMFiniteRatioFunction.mean_estimator()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMFiniteRatioFunction.power2_decreasing_exp"><code class="docutils literal notranslate"><span class="pre">CSMFiniteRatioFunction.power2_decreasing_exp()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMFiniteRatioFunction.ratios"><code class="docutils literal notranslate"><span class="pre">CSMFiniteRatioFunction.ratios()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMFiniteRatioFunction.smootherstep"><code class="docutils literal notranslate"><span class="pre">CSMFiniteRatioFunction.smootherstep()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMFiniteRatioFunction.smoothstep"><code class="docutils literal notranslate"><span class="pre">CSMFiniteRatioFunction.smoothstep()</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMInfiniteRatioFunction"><code class="docutils literal notranslate"><span class="pre">CSMInfiniteRatioFunction</span></code></a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMInfiniteRatioFunction.ALLOWED_FUNCTIONS"><code class="docutils literal notranslate"><span class="pre">CSMInfiniteRatioFunction.ALLOWED_FUNCTIONS</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMInfiniteRatioFunction.fractions"><code class="docutils literal notranslate"><span class="pre">CSMInfiniteRatioFunction.fractions()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMInfiniteRatioFunction.mean_estimator"><code class="docutils literal notranslate"><span class="pre">CSMInfiniteRatioFunction.mean_estimator()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMInfiniteRatioFunction.power2_inverse_decreasing"><code class="docutils literal notranslate"><span class="pre">CSMInfiniteRatioFunction.power2_inverse_decreasing()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMInfiniteRatioFunction.power2_inverse_power2_decreasing"><code class="docutils literal notranslate"><span class="pre">CSMInfiniteRatioFunction.power2_inverse_power2_decreasing()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMInfiniteRatioFunction.ratios"><code class="docutils literal notranslate"><span class="pre">CSMInfiniteRatioFunction.ratios()</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.DeltaCSMRatioFunction"><code class="docutils literal notranslate"><span class="pre">DeltaCSMRatioFunction</span></code></a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.DeltaCSMRatioFunction.ALLOWED_FUNCTIONS"><code class="docutils literal notranslate"><span class="pre">DeltaCSMRatioFunction.ALLOWED_FUNCTIONS</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.DeltaCSMRatioFunction.smootherstep"><code class="docutils literal notranslate"><span class="pre">DeltaCSMRatioFunction.smootherstep()</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.RatioFunction"><code class="docutils literal notranslate"><span class="pre">RatioFunction</span></code></a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.RatioFunction.ALLOWED_FUNCTIONS"><code class="docutils literal notranslate"><span class="pre">RatioFunction.ALLOWED_FUNCTIONS</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.RatioFunction.inverse_smootherstep"><code class="docutils literal notranslate"><span class="pre">RatioFunction.inverse_smootherstep()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.RatioFunction.inverse_smoothstep"><code class="docutils literal notranslate"><span class="pre">RatioFunction.inverse_smoothstep()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.RatioFunction.power2_decreasing_exp"><code class="docutils literal notranslate"><span class="pre">RatioFunction.power2_decreasing_exp()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.RatioFunction.power2_inverse_decreasing"><code class="docutils literal notranslate"><span class="pre">RatioFunction.power2_inverse_decreasing()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.RatioFunction.power2_inverse_power2_decreasing"><code class="docutils literal notranslate"><span class="pre">RatioFunction.power2_inverse_power2_decreasing()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.RatioFunction.smootherstep"><code class="docutils literal notranslate"><span class="pre">RatioFunction.smootherstep()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.RatioFunction.smoothstep"><code class="docutils literal notranslate"><span class="pre">RatioFunction.smoothstep()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#module-pymatgen.analysis.chemenv.utils.graph_utils">pymatgen.analysis.chemenv.utils.graph_utils module</a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.graph_utils.MultiGraphCycle"><code class="docutils literal notranslate"><span class="pre">MultiGraphCycle</span></code></a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.graph_utils.MultiGraphCycle.order"><code class="docutils literal notranslate"><span class="pre">MultiGraphCycle.order()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.graph_utils.MultiGraphCycle.validate"><code class="docutils literal notranslate"><span class="pre">MultiGraphCycle.validate()</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.graph_utils.SimpleGraphCycle"><code class="docutils literal notranslate"><span class="pre">SimpleGraphCycle</span></code></a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.graph_utils.SimpleGraphCycle.as_dict"><code class="docutils literal notranslate"><span class="pre">SimpleGraphCycle.as_dict()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.graph_utils.SimpleGraphCycle.from_dict"><code class="docutils literal notranslate"><span class="pre">SimpleGraphCycle.from_dict()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.graph_utils.SimpleGraphCycle.from_edges"><code class="docutils literal notranslate"><span class="pre">SimpleGraphCycle.from_edges()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.graph_utils.SimpleGraphCycle.order"><code class="docutils literal notranslate"><span class="pre">SimpleGraphCycle.order()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.graph_utils.SimpleGraphCycle.validate"><code class="docutils literal notranslate"><span class="pre">SimpleGraphCycle.validate()</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.graph_utils.get_all_elementary_cycles"><code class="docutils literal notranslate"><span class="pre">get_all_elementary_cycles()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.graph_utils.get_all_simple_paths_edges"><code class="docutils literal notranslate"><span class="pre">get_all_simple_paths_edges()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.graph_utils.get_delta"><code class="docutils literal notranslate"><span class="pre">get_delta()</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#module-pymatgen.analysis.chemenv.utils.math_utils">pymatgen.analysis.chemenv.utils.math_utils module</a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.math_utils.cosinus_step"><code class="docutils literal notranslate"><span class="pre">cosinus_step()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.math_utils.divisors"><code class="docutils literal notranslate"><span class="pre">divisors()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.math_utils.get_center_of_arc"><code class="docutils literal notranslate"><span class="pre">get_center_of_arc()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.math_utils.get_linearly_independent_vectors"><code class="docutils literal notranslate"><span class="pre">get_linearly_independent_vectors()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.math_utils.normal_cdf_step"><code class="docutils literal notranslate"><span class="pre">normal_cdf_step()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.math_utils.power2_decreasing_exp"><code class="docutils literal notranslate"><span class="pre">power2_decreasing_exp()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.math_utils.power2_inverse_decreasing"><code class="docutils literal notranslate"><span class="pre">power2_inverse_decreasing()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.math_utils.power2_inverse_power2_decreasing"><code class="docutils literal notranslate"><span class="pre">power2_inverse_power2_decreasing()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.math_utils.power2_inverse_powern_decreasing"><code class="docutils literal notranslate"><span class="pre">power2_inverse_powern_decreasing()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.math_utils.power2_tangent_decreasing"><code class="docutils literal notranslate"><span class="pre">power2_tangent_decreasing()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.math_utils.power3_step"><code class="docutils literal notranslate"><span class="pre">power3_step()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.math_utils.powern_decreasing"><code class="docutils literal notranslate"><span class="pre">powern_decreasing()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.math_utils.powern_parts_step"><code class="docutils literal notranslate"><span class="pre">powern_parts_step()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.math_utils.prime_factors"><code class="docutils literal notranslate"><span class="pre">prime_factors()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.math_utils.scale_and_clamp"><code class="docutils literal notranslate"><span class="pre">scale_and_clamp()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.math_utils.smootherstep"><code class="docutils literal notranslate"><span class="pre">smootherstep()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.math_utils.smoothstep"><code class="docutils literal notranslate"><span class="pre">smoothstep()</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#module-pymatgen.analysis.chemenv.utils.scripts_utils">pymatgen.analysis.chemenv.utils.scripts_utils module</a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.scripts_utils.compute_environments"><code class="docutils literal notranslate"><span class="pre">compute_environments()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.scripts_utils.draw_cg"><code class="docutils literal notranslate"><span class="pre">draw_cg()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.chemenv.utils.scripts_utils.visualize"><code class="docutils literal notranslate"><span class="pre">visualize()</span></code></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu"  style="background: linear-gradient(0deg, rgba(23,63,162,1) 0%, rgba(0,70,192,1) 100%)" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="index.html">pymatgen</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content style-external-links">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
      <li class="breadcrumb-item active">pymatgen.analysis.chemenv.utils package</li>
      <li class="wy-breadcrumbs-aside">
              <a href="https://github.com/materialsproject/pymatgen/blob/master/docs_rst/pymatgen.analysis.chemenv.utils.rst" class="fa fa-github"> Edit on GitHub</a>
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <section id="module-pymatgen.analysis.chemenv.utils">
<span id="pymatgen-analysis-chemenv-utils-package"></span><h1>pymatgen.analysis.chemenv.utils package<a class="headerlink" href="#module-pymatgen.analysis.chemenv.utils" title="Link to this heading"></a></h1>
<p>Utility package for chemenv.</p>
<section id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Link to this heading"></a></h2>
</section>
<section id="module-pymatgen.analysis.chemenv.utils.chemenv_config">
<span id="pymatgen-analysis-chemenv-utils-chemenv-config-module"></span><h2>pymatgen.analysis.chemenv.utils.chemenv_config module<a class="headerlink" href="#module-pymatgen.analysis.chemenv.utils.chemenv_config" title="Link to this heading"></a></h2>
<p>This module contains the classes for configuration of the chemenv package.</p>
<dl class="py class">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.chemenv_config.ChemEnvConfig">
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">ChemEnvConfig</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">package_options</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/chemenv_config.py#L25-L181"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.chemenv_config.ChemEnvConfig" title="Link to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Store the configuration of the chemenv package:
- Materials project access
- ICSD database access
- Default options (strategies, …).</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>package_options</strong></p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.chemenv_config.ChemEnvConfig.DEFAULT_PACKAGE_OPTIONS">
<span class="sig-name descname"><span class="pre">DEFAULT_PACKAGE_OPTIONS</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">ClassVar</span></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">{'default_max_distance_factor':</span> <span class="pre">1.5,</span> <span class="pre">'default_strategy':</span> <span class="pre">{'strategy':</span> <span class="pre">'SimplestChemenvStrategy',</span> <span class="pre">'strategy_options':</span> <span class="pre">{'additional_condition':</span> <span class="pre">1,</span> <span class="pre">'angle_cutoff':</span> <span class="pre">0.3,</span> <span class="pre">'continuous_symmetry_measure_cutoff':</span> <span class="pre">10,</span> <span class="pre">'distance_cutoff':</span> <span class="pre">1.4}}}</span></em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/chemenv/utils/chemenv_config.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.chemenv_config.ChemEnvConfig.DEFAULT_PACKAGE_OPTIONS" title="Link to this definition"></a></dt>
<dd></dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.chemenv_config.ChemEnvConfig.auto_load">
<em class="property"><span class="k"><span class="pre">classmethod</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">auto_load</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">root_dir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/chemenv_config.py#L161-L181"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.chemenv_config.ChemEnvConfig.auto_load" title="Link to this definition"></a></dt>
<dd><p>Autoload options.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>root_dir</strong></p>
</dd>
</dl>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.chemenv_config.ChemEnvConfig.has_materials_project_access">
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">has_materials_project_access</span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/chemenv/utils/chemenv_config.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.chemenv_config.ChemEnvConfig.has_materials_project_access" title="Link to this definition"></a></dt>
<dd><p>Whether MP access is enabled.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.chemenv_config.ChemEnvConfig.package_options_description">
<span class="sig-name descname"><span class="pre">package_options_description</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/chemenv_config.py#L126-L136"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.chemenv_config.ChemEnvConfig.package_options_description" title="Link to this definition"></a></dt>
<dd><p>Describe package options.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.chemenv_config.ChemEnvConfig.save">
<span class="sig-name descname"><span class="pre">save</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">root_dir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/chemenv_config.py#L138-L159"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.chemenv_config.ChemEnvConfig.save" title="Link to this definition"></a></dt>
<dd><p>Save the options.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>root_dir</strong></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.chemenv_config.ChemEnvConfig.setup">
<span class="sig-name descname"><span class="pre">setup</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/chemenv_config.py#L62-L88"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.chemenv_config.ChemEnvConfig.setup" title="Link to this definition"></a></dt>
<dd><p>Setup the class.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.chemenv_config.ChemEnvConfig.setup_package_options">
<span class="sig-name descname"><span class="pre">setup_package_options</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/chemenv_config.py#L95-L124"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.chemenv_config.ChemEnvConfig.setup_package_options" title="Link to this definition"></a></dt>
<dd><p>Setup the package options.</p>
</dd></dl>

</dd></dl>

</section>
<section id="module-pymatgen.analysis.chemenv.utils.chemenv_errors">
<span id="pymatgen-analysis-chemenv-utils-chemenv-errors-module"></span><h2>pymatgen.analysis.chemenv.utils.chemenv_errors module<a class="headerlink" href="#module-pymatgen.analysis.chemenv.utils.chemenv_errors" title="Link to this heading"></a></h2>
<p>This module contains the error classes for the chemenv package.</p>
<dl class="py exception">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.chemenv_errors.AbstractChemenvError">
<em class="property"><span class="k"><span class="pre">exception</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">AbstractChemenvError</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cls</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">method</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">msg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/chemenv_errors.py#L14-L29"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.chemenv_errors.AbstractChemenvError" title="Link to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">Exception</span></code></p>
<p>Abstract class for Chemenv errors.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cls</strong></p></li>
<li><p><strong>method</strong></p></li>
<li><p><strong>msg</strong></p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py exception">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.chemenv_errors.ChemenvError">
<em class="property"><span class="k"><span class="pre">exception</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">ChemenvError</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cls</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">method</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">msg</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/chemenv_errors.py#L74-L89"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.chemenv_errors.ChemenvError" title="Link to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">Exception</span></code></p>
<p>Chemenv error.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cls</strong></p></li>
<li><p><strong>method</strong></p></li>
<li><p><strong>msg</strong></p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py exception">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.chemenv_errors.EquivalentSiteSearchError">
<em class="property"><span class="k"><span class="pre">exception</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">EquivalentSiteSearchError</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">site</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/chemenv_errors.py#L46-L57"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.chemenv_errors.EquivalentSiteSearchError" title="Link to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#pymatgen.analysis.chemenv.utils.chemenv_errors.AbstractChemenvError" title="pymatgen.analysis.chemenv.utils.chemenv_errors.AbstractChemenvError"><code class="xref py py-class docutils literal notranslate"><span class="pre">AbstractChemenvError</span></code></a></p>
<p>Equivalent site search error.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>site</strong></p>
</dd>
</dl>
</dd></dl>

<dl class="py exception">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.chemenv_errors.NeighborsNotComputedChemenvError">
<em class="property"><span class="k"><span class="pre">exception</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">NeighborsNotComputedChemenvError</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">site</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/chemenv_errors.py#L32-L43"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.chemenv_errors.NeighborsNotComputedChemenvError" title="Link to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#pymatgen.analysis.chemenv.utils.chemenv_errors.AbstractChemenvError" title="pymatgen.analysis.chemenv.utils.chemenv_errors.AbstractChemenvError"><code class="xref py py-class docutils literal notranslate"><span class="pre">AbstractChemenvError</span></code></a></p>
<p>Neighbors not computed error.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>site</strong></p>
</dd>
</dl>
</dd></dl>

<dl class="py exception">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.chemenv_errors.SolidAngleError">
<em class="property"><span class="k"><span class="pre">exception</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">SolidAngleError</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cosinus</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/chemenv_errors.py#L60-L71"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.chemenv_errors.SolidAngleError" title="Link to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#pymatgen.analysis.chemenv.utils.chemenv_errors.AbstractChemenvError" title="pymatgen.analysis.chemenv.utils.chemenv_errors.AbstractChemenvError"><code class="xref py py-class docutils literal notranslate"><span class="pre">AbstractChemenvError</span></code></a></p>
<p>Solid angle error.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>cosinus</strong></p>
</dd>
</dl>
</dd></dl>

</section>
<section id="module-pymatgen.analysis.chemenv.utils.coordination_geometry_utils">
<span id="pymatgen-analysis-chemenv-utils-coordination-geometry-utils-module"></span><h2>pymatgen.analysis.chemenv.utils.coordination_geometry_utils module<a class="headerlink" href="#module-pymatgen.analysis.chemenv.utils.coordination_geometry_utils" title="Link to this heading"></a></h2>
<p>This module contains some utility functions and classes that are used in the chemenv package.</p>
<dl class="py class">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane">
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">Plane</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">coefficients</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p1</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p2</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p3</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L619-L1147"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane" title="Link to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Describe a plane.</p>
<p>Initialize a plane from the 4 coefficients a, b, c and d of ax + by + cz + d = 0.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>coefficients</strong> – abcd coefficients of the plane.</p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.TEST_2D_POINTS">
<span class="sig-name descname"><span class="pre">TEST_2D_POINTS</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">(array([0.,</span> <span class="pre">0.]),</span> <span class="pre">array([1.,</span> <span class="pre">0.]),</span> <span class="pre">array([0.,</span> <span class="pre">1.]),</span> <span class="pre">array([-1.,</span>&#160; <span class="pre">0.]),</span> <span class="pre">array([</span> <span class="pre">0.,</span> <span class="pre">-1.]),</span> <span class="pre">array([0.,</span> <span class="pre">2.]),</span> <span class="pre">array([2.,</span> <span class="pre">0.]),</span> <span class="pre">array([</span> <span class="pre">0.,</span> <span class="pre">-2.]),</span> <span class="pre">array([-2.,</span>&#160; <span class="pre">0.]),</span> <span class="pre">array([1.,</span> <span class="pre">1.]),</span> <span class="pre">array([2.,</span> <span class="pre">2.]),</span> <span class="pre">array([-1.,</span> <span class="pre">-1.]),</span> <span class="pre">array([-2.,</span> <span class="pre">-2.]),</span> <span class="pre">array([1.,</span> <span class="pre">2.]),</span> <span class="pre">array([</span> <span class="pre">1.,</span> <span class="pre">-2.]),</span> <span class="pre">array([-1.,</span>&#160; <span class="pre">2.]),</span> <span class="pre">array([-1.,</span> <span class="pre">-2.]),</span> <span class="pre">array([2.,</span> <span class="pre">1.]),</span> <span class="pre">array([</span> <span class="pre">2.,</span> <span class="pre">-1.]),</span> <span class="pre">array([-2.,</span>&#160; <span class="pre">1.]),</span> <span class="pre">array([-2.,</span> <span class="pre">-1.]))</span></em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.TEST_2D_POINTS" title="Link to this definition"></a></dt>
<dd></dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.a">
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">a</span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.a" title="Link to this definition"></a></dt>
<dd><p>Coefficient a of the plane.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.abcd">
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">abcd</span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.abcd" title="Link to this definition"></a></dt>
<dd><p>A tuple with the plane coefficients.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.b">
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">b</span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.b" title="Link to this definition"></a></dt>
<dd><p>Coefficient b of the plane.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.c">
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">c</span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.c" title="Link to this definition"></a></dt>
<dd><p>Coefficient c of the plane.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.coefficients">
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">coefficients</span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.coefficients" title="Link to this definition"></a></dt>
<dd><p>A copy of the plane coefficients as a numpy array.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.crosses_origin">
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">crosses_origin</span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.crosses_origin" title="Link to this definition"></a></dt>
<dd><p>Whether this plane crosses the origin (i.e. coefficient d is 0.0).</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.d">
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">d</span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.d" title="Link to this definition"></a></dt>
<dd><p>Coefficient d of the plane.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.distance_to_origin">
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">distance_to_origin</span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.distance_to_origin" title="Link to this definition"></a></dt>
<dd><p>Distance of the plane to the origin.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.distance_to_point">
<span class="sig-name descname"><span class="pre">distance_to_point</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">point</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L777-L786"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.distance_to_point" title="Link to this definition"></a></dt>
<dd><p>Compute the absolute distance from the plane to the point.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>point</strong> – Point for which distance is computed</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Distance between the plane and the point.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.distances">
<span class="sig-name descname"><span class="pre">distances</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">points</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L788-L799"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.distances" title="Link to this definition"></a></dt>
<dd><p>Compute the distances from the plane to each of the points. Positive distances are on
the side of the normal of the plane while negative distances are on the other side.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>points</strong> – Points for which distances are computed</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Distances from the plane to the points (positive values on the side of the normal to the plane,
negative values on the other side).</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.distances_indices_groups">
<span class="sig-name descname"><span class="pre">distances_indices_groups</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">points</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">delta</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">delta_factor</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.05</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sign</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L821-L852"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.distances_indices_groups" title="Link to this definition"></a></dt>
<dd><p>Compute the distances from the plane to each of the points. Positive distances are on the side of the
normal of the plane while negative distances are on the other side. Indices sorting the points from closest
to furthest is also computed. Grouped indices are also given, for which indices of the distances that are
separated by less than delta are grouped together. The delta parameter is either set explicitly or taken as
a fraction (using the delta_factor parameter) of the maximal point distance.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>points</strong> – Points for which distances are computed</p></li>
<li><p><strong>delta</strong> – Distance interval for which two points are considered in the same group.</p></li>
<li><p><strong>delta_factor</strong> – If delta is None, the distance interval is taken as delta_factor times the maximal</p></li>
<li><p><strong>distance.</strong> (<em>point</em>)</p></li>
<li><p><strong>sign</strong> – Whether to add sign information in the indices sorting the points distances</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Distances from the plane to the points (positive values on the side of the normal to the plane,
negative values on the other side), as well as indices of the points from closest to furthest and
grouped indices of distances separated by less than delta. For the sorting list and the grouped
indices, when the sign parameter is True, items are given as tuples of (index, sign).</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.distances_indices_sorted">
<span class="sig-name descname"><span class="pre">distances_indices_sorted</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">points</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sign</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L801-L819"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.distances_indices_sorted" title="Link to this definition"></a></dt>
<dd><p>Compute the distances from the plane to each of the points. Positive distances are
on the side of the normal of the plane while negative distances are on the other
side. Indices sorting the points from closest to furthest is also computed.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>points</strong> – Points for which distances are computed</p></li>
<li><p><strong>sign</strong> – Whether to add sign information in the indices sorting the points distances</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Distances from the plane to the points (positive values on the side of the normal to the plane,
negative values on the other side), as well as indices of the points from closest to furthest. For the
latter, when the sign parameter is True, items of the sorting list are given as tuples of (index, sign).</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.fit_error">
<span class="sig-name descname"><span class="pre">fit_error</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">points</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fit</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'least_square_distance'</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L923-L937"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.fit_error" title="Link to this definition"></a></dt>
<dd><p>Evaluate the error for a list of points with respect to this plane.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>points</strong> – List of points.</p></li>
<li><p><strong>fit</strong> – Type of fit error.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Error for a list of points with respect to this plane.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.fit_least_square_distance_error">
<span class="sig-name descname"><span class="pre">fit_least_square_distance_error</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">points</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L939-L948"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.fit_least_square_distance_error" title="Link to this definition"></a></dt>
<dd><p>Evaluate the sum of squared distances error for a list of points with respect to this plane.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>points</strong> – List of points.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Sum of squared distances error for a list of points with respect to this plane.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.fit_maximum_distance_error">
<span class="sig-name descname"><span class="pre">fit_maximum_distance_error</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">points</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L950-L959"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.fit_maximum_distance_error" title="Link to this definition"></a></dt>
<dd><p>Evaluate the max distance error for a list of points with respect to this plane.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>points</strong> – List of points.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Max distance error for a list of points with respect to this plane.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.from_2points_and_origin">
<em class="property"><span class="k"><span class="pre">classmethod</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">from_2points_and_origin</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">p1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p2</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Self</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L1001-L1012"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.from_2points_and_origin" title="Link to this definition"></a></dt>
<dd><p>Initialize plane from two points and the origin.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>p1</strong> – First point.</p></li>
<li><p><strong>p2</strong> – Second point.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Plane.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.from_3points">
<em class="property"><span class="k"><span class="pre">classmethod</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">from_3points</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">p1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p3</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Self</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L1014-L1033"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.from_3points" title="Link to this definition"></a></dt>
<dd><p>Initialize plane from three points.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>p1</strong> – First point.</p></li>
<li><p><strong>p2</strong> – Second point.</p></li>
<li><p><strong>p3</strong> – Third point.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Plane.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.from_coefficients">
<em class="property"><span class="k"><span class="pre">classmethod</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">from_coefficients</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">c</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">d</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Self</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L1134-L1147"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.from_coefficients" title="Link to this definition"></a></dt>
<dd><p>Initialize plane from its coefficients.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>a</strong> – a coefficient of the plane.</p></li>
<li><p><strong>b</strong> – b coefficient of the plane.</p></li>
<li><p><strong>c</strong> – c coefficient of the plane.</p></li>
<li><p><strong>d</strong> – d coefficient of the plane.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Plane.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.from_npoints">
<em class="property"><span class="k"><span class="pre">classmethod</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">from_npoints</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">points</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">best_fit</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'least_square_distance'</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Self</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L1035-L1057"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.from_npoints" title="Link to this definition"></a></dt>
<dd><p>Initialize plane from a list of points.</p>
<p>If the number of points is larger than 3, will use a least square fitting or max distance fitting.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>points</strong> – List of points.</p></li>
<li><p><strong>best_fit</strong> – Type of fitting procedure for more than 3 points.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Plane</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.from_npoints_least_square_distance">
<em class="property"><span class="k"><span class="pre">classmethod</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">from_npoints_least_square_distance</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">points</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Self</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L1059-L1083"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.from_npoints_least_square_distance" title="Link to this definition"></a></dt>
<dd><p>Initialize plane from a list of points using a least square fitting procedure.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>points</strong> – List of points.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Plane.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.from_npoints_maximum_distance">
<em class="property"><span class="k"><span class="pre">classmethod</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">from_npoints_maximum_distance</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">points</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Self</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L1104-L1132"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.from_npoints_maximum_distance" title="Link to this definition"></a></dt>
<dd><p>Initialize plane from a list of points using a max distance fitting procedure.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>points</strong> – List of points.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Plane.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.indices_separate">
<span class="sig-name descname"><span class="pre">indices_separate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">points</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dist_tolerance</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L751-L775"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.indices_separate" title="Link to this definition"></a></dt>
<dd><p>Get three lists containing the indices of the points lying on one side of the plane, on the plane
and on the other side of the plane. The dist_tolerance parameter controls the tolerance to which a point
is considered to lie on the plane or not (distance to the plane).</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>points</strong> – list of points</p></li>
<li><p><strong>dist_tolerance</strong> – tolerance to which a point is considered to lie on the plane
or not (distance to the plane)</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>The lists of indices of the points on one side of the plane, on the plane and
on the other side of the plane.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.init_3points">
<span class="sig-name descname"><span class="pre">init_3points</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">non_zeros</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">zeros</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L680-L704"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.init_3points" title="Link to this definition"></a></dt>
<dd><p>Initialize three random points on this plane.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>non_zeros</strong> – Indices of plane coefficients ([a, b, c]) that are not zero.</p></li>
<li><p><strong>zeros</strong> – Indices of plane coefficients ([a, b, c]) that are equal to zero.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.is_in_list">
<span class="sig-name descname"><span class="pre">is_in_list</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">plane_list</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L739-L749"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.is_in_list" title="Link to this definition"></a></dt>
<dd><p>Checks whether the plane is identical to one of the Planes in the plane_list list of Planes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>plane_list</strong> – List of Planes to be compared to</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>True if the plane is in the list.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.is_in_plane">
<span class="sig-name descname"><span class="pre">is_in_plane</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pp</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dist_tolerance</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L714-L725"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.is_in_plane" title="Link to this definition"></a></dt>
<dd><p>Determines if point pp is in the plane within the tolerance dist_tolerance.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>pp</strong> – point to be tested</p></li>
<li><p><strong>dist_tolerance</strong> – tolerance on the distance to the plane within which point pp is considered in the plane</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>True if pp is in the plane.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.is_same_plane_as">
<span class="sig-name descname"><span class="pre">is_same_plane_as</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">plane</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L727-L737"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.is_same_plane_as" title="Link to this definition"></a></dt>
<dd><p>Checks whether the plane is identical to another Plane “plane”.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>plane</strong> – Plane to be compared to</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>True if the two facets are identical.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.orthonormal_vectors">
<span class="sig-name descname"><span class="pre">orthonormal_vectors</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L866-L878"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.orthonormal_vectors" title="Link to this definition"></a></dt>
<dd><p>Get a list of three orthogonal vectors, the two first being parallel to the plane and the
third one is the normal vector of the plane.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>List of orthogonal vectors</p>
</dd>
<dt class="field-even">Raise<span class="colon">:</span></dt>
<dd class="field-even"><p>ValueError if all the coefficients are zero or if there is some other strange error.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.perpendicular_bisector">
<em class="property"><span class="k"><span class="pre">classmethod</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">perpendicular_bisector</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">p1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p2</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Self</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L1085-L1102"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.perpendicular_bisector" title="Link to this definition"></a></dt>
<dd><p>Initialize a plane from the perpendicular bisector of two points.</p>
<p>The perpendicular bisector of two points is the plane perpendicular to the vector joining these two points
and passing through the middle of the segment joining the two points.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>p1</strong> – First point.</p></li>
<li><p><strong>p2</strong> – Second point.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Plane.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.project_and_to2dim">
<span class="sig-name descname"><span class="pre">project_and_to2dim</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pps</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">plane_center</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L894-L921"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.project_and_to2dim" title="Link to this definition"></a></dt>
<dd><p>Projects the list of points pps to the plane and changes the basis from 3D to the 2D basis of the plane.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>pps</strong> – List of points to be projected</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>raise:</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.project_and_to2dim_ordered_indices">
<span class="sig-name descname"><span class="pre">project_and_to2dim_ordered_indices</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pps</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">plane_center</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'mean'</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L880-L892"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.project_and_to2dim_ordered_indices" title="Link to this definition"></a></dt>
<dd><p>Projects each points in the point list pps on plane and returns the indices that would sort the
list of projected points in anticlockwise order.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>pps</strong> – List of points to project on plane</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>List of indices that would sort the list of projected points.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.projectionpoints">
<span class="sig-name descname"><span class="pre">projectionpoints</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pps</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L854-L864"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.Plane.projectionpoints" title="Link to this definition"></a></dt>
<dd><p>Projects each points in the point list pps on plane and returns the list of projected points.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>pps</strong> – List of points to project on plane</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>List of projected point on plane.</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.anticlockwise_sort">
<span class="sig-name descname"><span class="pre">anticlockwise_sort</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pps</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L511-L528"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.anticlockwise_sort" title="Link to this definition"></a></dt>
<dd><p>Sort a list of 2D points in anticlockwise order.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>pps</strong> – List of points to be sorted</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Sorted list of points.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.anticlockwise_sort_indices">
<span class="sig-name descname"><span class="pre">anticlockwise_sort_indices</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pps</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L531-L543"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.anticlockwise_sort_indices" title="Link to this definition"></a></dt>
<dd><p>Get the indices that would sort a list of 2D points in anticlockwise order.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>pps</strong> – List of points to be sorted</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Indices of the sorted list of points.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.changebasis">
<span class="sig-name descname"><span class="pre">changebasis</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">uu</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">vv</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">nn</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">pps</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L461-L481"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.changebasis" title="Link to this definition"></a></dt>
<dd><p>For a list of points given in standard coordinates (in terms of e1, e2 and e3), returns the same list
expressed in the basis (uu, vv, nn), which is supposed to be orthonormal.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>uu</strong> – First vector of the basis</p></li>
<li><p><strong>vv</strong> – Second vector of the basis</p></li>
<li><p><strong>nn</strong> – Third vector of the basis</p></li>
<li><p><strong>pps</strong> – List of points in basis (e1, e2, e3)</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>List of points in basis (uu, vv, nn).</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.collinear">
<span class="sig-name descname"><span class="pre">collinear</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">p1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p3</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tolerance</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.25</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L484-L508"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.collinear" title="Link to this definition"></a></dt>
<dd><p>Checks if the three points p1, p2 and p3 are collinear or not within a given tolerance. The collinearity is
checked by computing the area of the triangle defined by the three points p1, p2 and p3. If the area of this
triangle is less than (tolerance x largest_triangle), then the three points are considered collinear. The
largest_triangle is defined as the right triangle whose legs are the two smallest distances between the three</p>
<blockquote>
<div><p>points ie, its area is : 0.5 x (min(<a href="#id5"><span class="problematic" id="id6">|p2-p1|</span></a>,|p3-p1|,|p3-p2|) x second_min(<a href="#id7"><span class="problematic" id="id8">|p2-p1|</span></a>,|p3-p1|,|p3-p2|)).</p>
</div></blockquote>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>p1</strong> – First point</p></li>
<li><p><strong>p2</strong> – Second point</p></li>
<li><p><strong>p3</strong> – Third point (origin [0.0, 0.0, 0.0 if not given])</p></li>
<li><p><strong>tolerance</strong> – Area tolerance for the collinearity test (0.25 gives about 0.125 deviation from the line)</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>True if the three points are considered as collinear within the given tolerance.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.diamond_functions">
<span class="sig-name descname"><span class="pre">diamond_functions</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xx</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">yy</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y_x0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x_y0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L176-L261"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.diamond_functions" title="Link to this definition"></a></dt>
<dd><p>Method that creates two upper and lower functions based on points xx and yy
as well as intercepts defined by y_x0 and x_y0. The resulting functions
form kind of a distorted diamond-like structure aligned from
point xx to point yy.</p>
<p>Schematically :</p>
<p>xx is symbolized by x, yy is symbolized by y, y_x0 is equal to the distance
from x to a, x_y0 is equal to the distance from x to b, the lines a-p and
b-q are parallel to the line x-y such that points p and q are
obtained automatically.
In case of an increasing diamond the lower function is x-b-q and the upper
function is a-p-y while in case of a
decreasing diamond, the lower function is a-p-y and the upper function is
x-b-q.</p>
<blockquote>
<div><dl>
<dt>Increasing diamond      |     Decreasing diamond</dt><dd><blockquote>
<div><blockquote>
<div><blockquote>
<div><blockquote>
<div><p>p–y                    x—-b</p>
</div></blockquote>
<p>/  /|                    <a href="#id1"><span class="problematic" id="id2">|</span></a>   </p>
</div></blockquote>
<p>/  / |                    |    q</p>
</div></blockquote>
<p>/  /  |                    a    |</p>
</div></blockquote>
<p>a  /   |                       |
| /    q                       |
<a href="#id3"><span class="problematic" id="id4">|</span></a>/    /                         |
x—-b                          p–y</p>
</dd>
</dl>
</div></blockquote>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xx</strong> – First point</p></li>
<li><p><strong>yy</strong> – Second point</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>A dictionary with the lower and upper diamond functions.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.function_comparison">
<span class="sig-name descname"><span class="pre">function_comparison</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">f1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">f2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">numpoints_check</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">500</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L64-L94"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.function_comparison" title="Link to this definition"></a></dt>
<dd><p>Method that compares two functions.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>f1</strong> – First function to compare</p></li>
<li><p><strong>f2</strong> – Second function to compare</p></li>
<li><p><strong>x1</strong> – Lower bound of the interval to compare</p></li>
<li><p><strong>x2</strong> – Upper bound of the interval to compare</p></li>
<li><p><strong>numpoints_check</strong> – Number of points used to compare the functions</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><dl class="simple">
<dt>‘=’ if the functions are equal, ‘&lt;’ if f1 is always lower than f2, ‘&gt;’ if f1 is always larger than f2,</dt><dd><p>f1 is always lower than or equal to f2 (“&lt;”), f1 is always larger than or equal to f2 (“&gt;”) on the
interval [x1, x2]. If the two functions cross, a RuntimeError is thrown (i.e. we expect to compare
functions that do not cross…)</p>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.get_lower_and_upper_f">
<span class="sig-name descname"><span class="pre">get_lower_and_upper_f</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">surface_calculation_options</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L31-L61"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.get_lower_and_upper_f" title="Link to this definition"></a></dt>
<dd><p>Get the lower and upper functions defining a surface in the distance-angle space of neighbors.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>surface_calculation_options</strong> – Options for the surface.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Dictionary containing the “lower” and “upper” functions for the surface.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.is_anion_cation_bond">
<span class="sig-name descname"><span class="pre">is_anion_cation_bond</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">valences</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ii</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">jj</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L600-L616"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.is_anion_cation_bond" title="Link to this definition"></a></dt>
<dd><p>Checks if two given sites are an anion and a cation.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>valences</strong> – list of site valences</p></li>
<li><p><strong>ii</strong> – index of a site</p></li>
<li><p><strong>jj</strong> – index of another site</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>True if one site is an anion and the other is a cation (based on valences).</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.matrixTimesVector">
<span class="sig-name descname"><span class="pre">matrixTimesVector</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">MM</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">aa</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L414-L426"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.matrixTimesVector" title="Link to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>MM</strong> – A matrix of size 3x3</p></li>
<li><p><strong>aa</strong> – A vector of size 3.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>A vector of size 3 which is the product of the matrix by the vector</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.quarter_ellipsis_functions">
<span class="sig-name descname"><span class="pre">quarter_ellipsis_functions</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xx</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ArrayLike</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">yy</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ArrayLike</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">dict</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">Callable</span><span class="p"><span class="pre">]</span></span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L97-L141"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.quarter_ellipsis_functions" title="Link to this definition"></a></dt>
<dd><p>Method that creates two quarter-ellipse functions based on points xx and yy. The ellipsis is supposed to
be aligned with the axes. The two ellipsis pass through the two points xx and yy.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xx</strong> – First point</p></li>
<li><p><strong>yy</strong> – Second point</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>A dictionary with the lower and upper quarter ellipsis functions.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.rectangle_surface_intersection">
<span class="sig-name descname"><span class="pre">rectangle_surface_intersection</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">rectangle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">f_lower</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">f_upper</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">bounds_lower</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">bounds_upper</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">check</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">numpoints_check</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">500</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L264-L356"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.rectangle_surface_intersection" title="Link to this definition"></a></dt>
<dd><p>Method to calculate the surface of the intersection of a rectangle (aligned with axes) and another surface
defined by two functions f_lower and f_upper.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>rectangle</strong> – Rectangle defined as : ((x1, x2), (y1, y2)).</p></li>
<li><p><strong>f_lower</strong> – Function defining the lower bound of the surface.</p></li>
<li><p><strong>f_upper</strong> – Function defining the upper bound of the surface.</p></li>
<li><p><strong>bounds_lower</strong> – Interval in which the f_lower function is defined.</p></li>
<li><p><strong>bounds_upper</strong> – Interval in which the f_upper function is defined.</p></li>
<li><p><strong>check</strong> – Whether to check if f_lower is always lower than f_upper.</p></li>
<li><p><strong>numpoints_check</strong> – Number of points used to check whether f_lower is always lower than f_upper</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>The surface of the intersection of the rectangle and the surface defined by f_lower and f_upper.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.rotateCoords">
<span class="sig-name descname"><span class="pre">rotateCoords</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">coords</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">R</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L429-L444"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.rotateCoords" title="Link to this definition"></a></dt>
<dd><p>Rotate the list of points using rotation matrix R.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>coords</strong> – List of points to be rotated</p></li>
<li><p><strong>R</strong> – Rotation matrix</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>List of rotated points.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.rotateCoordsOpt">
<span class="sig-name descname"><span class="pre">rotateCoordsOpt</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">coords</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">R</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L447-L458"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.rotateCoordsOpt" title="Link to this definition"></a></dt>
<dd><p>Rotate the list of points using rotation matrix R.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>coords</strong> – List of points to be rotated</p></li>
<li><p><strong>R</strong> – Rotation matrix</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>List of rotated points.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.separation_in_list">
<span class="sig-name descname"><span class="pre">separation_in_list</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">separation_indices</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">separation_indices_list</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L582-L597"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.separation_in_list" title="Link to this definition"></a></dt>
<dd><p>Checks if the separation indices of a plane are already in the list.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>separation_indices</strong> – list of separation indices (three arrays of integers)</p></li>
<li><p><strong>separation_indices_list</strong> – list of the list of separation indices to be compared to</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>True if the separation indices are already in the list.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.solid_angle">
<span class="sig-name descname"><span class="pre">solid_angle</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">center</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">coords</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L359-L393"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.solid_angle" title="Link to this definition"></a></dt>
<dd><p>Helper method to calculate the solid angle of a set of coords from the center.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>center</strong> – Center to measure solid angle from.</p></li>
<li><p><strong>coords</strong> – List of coords to determine solid angle.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>The solid angle.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.sort_separation">
<span class="sig-name descname"><span class="pre">sort_separation</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">separation</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L546-L557"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.sort_separation" title="Link to this definition"></a></dt>
<dd><p>Sort a separation.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>separation</strong> – Initial separation.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Sorted list of separation.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.sort_separation_tuple">
<span class="sig-name descname"><span class="pre">sort_separation_tuple</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">separation</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L560-L579"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.sort_separation_tuple" title="Link to this definition"></a></dt>
<dd><p>Sort a separation.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>separation</strong> – Initial separation</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Sorted tuple of separation</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.spline_functions">
<span class="sig-name descname"><span class="pre">spline_functions</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">lower_points</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">upper_points</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">degree</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">3</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L144-L173"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.spline_functions" title="Link to this definition"></a></dt>
<dd><p>Method that creates two (upper and lower) spline functions based on points lower_points and upper_points.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>lower_points</strong> – Points defining the lower function.</p></li>
<li><p><strong>upper_points</strong> – Points defining the upper function.</p></li>
<li><p><strong>degree</strong> – Degree for the spline function</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>A dictionary with the lower and upper spline functions.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.coordination_geometry_utils.vectorsToMatrix">
<span class="sig-name descname"><span class="pre">vectorsToMatrix</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">aa</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">bb</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/coordination_geometry_utils.py#L396-L411"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.coordination_geometry_utils.vectorsToMatrix" title="Link to this definition"></a></dt>
<dd><p>Performs the vector multiplication of the elements of two vectors, constructing the 3x3 matrix.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>aa</strong> – One vector of size 3</p></li>
<li><p><strong>bb</strong> – Another vector of size 3</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>M_ij = aa_i * bb_j.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>A 3x3 matrix M composed of the products of the elements of aa and bb</p>
</dd>
</dl>
</dd></dl>

</section>
<section id="module-pymatgen.analysis.chemenv.utils.defs_utils">
<span id="pymatgen-analysis-chemenv-utils-defs-utils-module"></span><h2>pymatgen.analysis.chemenv.utils.defs_utils module<a class="headerlink" href="#module-pymatgen.analysis.chemenv.utils.defs_utils" title="Link to this heading"></a></h2>
<p>This module contains the definition of some objects used in the chemenv package.</p>
<dl class="py class">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions">
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">AdditionalConditions</span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/defs_utils.py#L46-L105"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions" title="Link to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Additional conditions that can be used to filter coordination environments.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.ALL">
<span class="sig-name descname"><span class="pre">ALL</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">(0,</span> <span class="pre">1,</span> <span class="pre">2,</span> <span class="pre">3,</span> <span class="pre">4)</span></em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/chemenv/utils/defs_utils.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.ALL" title="Link to this definition"></a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.CONDITION_DESCRIPTION">
<span class="sig-name descname"><span class="pre">CONDITION_DESCRIPTION</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">ClassVar</span></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">{0:</span> <span class="pre">'No</span> <span class="pre">additional</span> <span class="pre">condition',</span> <span class="pre">1:</span> <span class="pre">'Only</span> <span class="pre">anion-cation</span> <span class="pre">bonds',</span> <span class="pre">2:</span> <span class="pre">'No</span> <span class="pre">element-element</span> <span class="pre">bonds</span> <span class="pre">(same</span> <span class="pre">elements)',</span> <span class="pre">3:</span> <span class="pre">'Only</span> <span class="pre">anion-cation</span> <span class="pre">bonds</span> <span class="pre">and</span> <span class="pre">no</span> <span class="pre">element-element</span> <span class="pre">bonds</span> <span class="pre">(same</span> <span class="pre">elements)',</span> <span class="pre">4:</span> <span class="pre">'Only</span> <span class="pre">element-oxygen</span> <span class="pre">bonds'}</span></em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/chemenv/utils/defs_utils.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.CONDITION_DESCRIPTION" title="Link to this definition"></a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.NONE">
<span class="sig-name descname"><span class="pre">NONE</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">0</span></em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/chemenv/utils/defs_utils.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.NONE" title="Link to this definition"></a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.NO_AC">
<span class="sig-name descname"><span class="pre">NO_AC</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">0</span></em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/chemenv/utils/defs_utils.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.NO_AC" title="Link to this definition"></a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.NO_ADDITIONAL_CONDITION">
<span class="sig-name descname"><span class="pre">NO_ADDITIONAL_CONDITION</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">0</span></em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/chemenv/utils/defs_utils.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.NO_ADDITIONAL_CONDITION" title="Link to this definition"></a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.NO_E2SEB">
<span class="sig-name descname"><span class="pre">NO_E2SEB</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">2</span></em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/chemenv/utils/defs_utils.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.NO_E2SEB" title="Link to this definition"></a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.NO_ELEMENT_TO_SAME_ELEMENT_BONDS">
<span class="sig-name descname"><span class="pre">NO_ELEMENT_TO_SAME_ELEMENT_BONDS</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">2</span></em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/chemenv/utils/defs_utils.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.NO_ELEMENT_TO_SAME_ELEMENT_BONDS" title="Link to this definition"></a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.ONLY_ACB">
<span class="sig-name descname"><span class="pre">ONLY_ACB</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">1</span></em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/chemenv/utils/defs_utils.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.ONLY_ACB" title="Link to this definition"></a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.ONLY_ACB_AND_NO_E2SEB">
<span class="sig-name descname"><span class="pre">ONLY_ACB_AND_NO_E2SEB</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">3</span></em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/chemenv/utils/defs_utils.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.ONLY_ACB_AND_NO_E2SEB" title="Link to this definition"></a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.ONLY_ANION_CATION_BONDS">
<span class="sig-name descname"><span class="pre">ONLY_ANION_CATION_BONDS</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">1</span></em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/chemenv/utils/defs_utils.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.ONLY_ANION_CATION_BONDS" title="Link to this definition"></a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.ONLY_ANION_CATION_BONDS_AND_NO_ELEMENT_TO_SAME_ELEMENT_BONDS">
<span class="sig-name descname"><span class="pre">ONLY_ANION_CATION_BONDS_AND_NO_ELEMENT_TO_SAME_ELEMENT_BONDS</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">3</span></em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/chemenv/utils/defs_utils.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.ONLY_ANION_CATION_BONDS_AND_NO_ELEMENT_TO_SAME_ELEMENT_BONDS" title="Link to this definition"></a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.ONLY_E2OB">
<span class="sig-name descname"><span class="pre">ONLY_E2OB</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">4</span></em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/chemenv/utils/defs_utils.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.ONLY_E2OB" title="Link to this definition"></a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.ONLY_ELEMENT_TO_OXYGEN_BONDS">
<span class="sig-name descname"><span class="pre">ONLY_ELEMENT_TO_OXYGEN_BONDS</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">4</span></em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/chemenv/utils/defs_utils.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.ONLY_ELEMENT_TO_OXYGEN_BONDS" title="Link to this definition"></a></dt>
<dd></dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.check_condition">
<span class="sig-name descname"><span class="pre">check_condition</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">condition</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">structure</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><span class="pre">Structure</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">parameters</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/defs_utils.py#L72-L105"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.defs_utils.AdditionalConditions.check_condition" title="Link to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>condition</strong></p></li>
<li><p><strong>structure</strong></p></li>
<li><p><strong>parameters</strong></p></li>
</ul>
</dd>
</dl>
</dd></dl>

</dd></dl>

</section>
<section id="module-pymatgen.analysis.chemenv.utils.func_utils">
<span id="pymatgen-analysis-chemenv-utils-func-utils-module"></span><h2>pymatgen.analysis.chemenv.utils.func_utils module<a class="headerlink" href="#module-pymatgen.analysis.chemenv.utils.func_utils" title="Link to this heading"></a></h2>
<p>This module contains some utility functions and classes that are used in the chemenv package.</p>
<dl class="py class">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.AbstractRatioFunction">
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">AbstractRatioFunction</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">function</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">options_dict</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/func_utils.py#L31-L113"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.AbstractRatioFunction" title="Link to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Abstract class for all ratio functions.</p>
<p>Constructor for AbstractRatioFunction.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>function</strong> – Ration function name.</p></li>
<li><p><strong>options_dict</strong> – Dictionary containing the parameters for the ratio function.</p></li>
</ul>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.AbstractRatioFunction.ALLOWED_FUNCTIONS">
<span class="sig-name descname"><span class="pre">ALLOWED_FUNCTIONS</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">ClassVar</span><span class="p"><span class="pre">[</span></span><span class="pre">dict</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">list</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">{}</span></em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/chemenv/utils/func_utils.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.AbstractRatioFunction.ALLOWED_FUNCTIONS" title="Link to this definition"></a></dt>
<dd></dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.AbstractRatioFunction.evaluate">
<span class="sig-name descname"><span class="pre">evaluate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/func_utils.py#L95-L104"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.AbstractRatioFunction.evaluate" title="Link to this definition"></a></dt>
<dd><p>Evaluate the ratio function for the given value.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>value</strong> – Value for which ratio function has to be evaluated.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Ratio function corresponding to the value.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.AbstractRatioFunction.from_dict">
<em class="property"><span class="k"><span class="pre">classmethod</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">from_dict</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dct</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">dict</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Self</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/func_utils.py#L106-L113"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.AbstractRatioFunction.from_dict" title="Link to this definition"></a></dt>
<dd><p>Construct ratio function from dict.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>dct</strong> (<em>dict</em>) – Dict representation of the ratio function</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.AbstractRatioFunction.setup_parameters">
<span class="sig-name descname"><span class="pre">setup_parameters</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">options_dict</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/func_utils.py#L49-L93"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.AbstractRatioFunction.setup_parameters" title="Link to this definition"></a></dt>
<dd><p>Set up the parameters for this ratio function.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>options_dict</strong> – Dictionary containing the parameters for the ratio function.</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.CSMFiniteRatioFunction">
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">CSMFiniteRatioFunction</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">function</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">options_dict</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/func_utils.py#L222-L320"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMFiniteRatioFunction" title="Link to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.AbstractRatioFunction" title="pymatgen.analysis.chemenv.utils.func_utils.AbstractRatioFunction"><code class="xref py py-class docutils literal notranslate"><span class="pre">AbstractRatioFunction</span></code></a></p>
<p>Concrete implementation of a series of ratio functions applied to the continuous symmetry measure (CSM).</p>
<p>Uses “finite” ratio functions.</p>
<p>See the following reference for details:
ChemEnv: a fast and robust coordination environment identification tool,
D. Waroquiers et al., Acta Cryst. B 76, 683 (2020).</p>
<p>Constructor for AbstractRatioFunction.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>function</strong> – Ration function name.</p></li>
<li><p><strong>options_dict</strong> – Dictionary containing the parameters for the ratio function.</p></li>
</ul>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.CSMFiniteRatioFunction.ALLOWED_FUNCTIONS">
<span class="sig-name descname"><span class="pre">ALLOWED_FUNCTIONS</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">ClassVar</span></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">{'power2_decreasing_exp':</span> <span class="pre">['max_csm',</span> <span class="pre">'alpha'],</span> <span class="pre">'smootherstep':</span> <span class="pre">['lower_csm',</span> <span class="pre">'upper_csm'],</span> <span class="pre">'smoothstep':</span> <span class="pre">['lower_csm',</span> <span class="pre">'upper_csm']}</span></em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/chemenv/utils/func_utils.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMFiniteRatioFunction.ALLOWED_FUNCTIONS" title="Link to this definition"></a></dt>
<dd></dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.CSMFiniteRatioFunction.fractions">
<span class="sig-name descname"><span class="pre">fractions</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/func_utils.py#L286-L300"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMFiniteRatioFunction.fractions" title="Link to this definition"></a></dt>
<dd><p>Get the fractions from the CSM ratio function applied to the data.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>data</strong> – List of CSM values to estimate fractions.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Corresponding fractions for each CSM.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.CSMFiniteRatioFunction.mean_estimator">
<span class="sig-name descname"><span class="pre">mean_estimator</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/func_utils.py#L302-L318"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMFiniteRatioFunction.mean_estimator" title="Link to this definition"></a></dt>
<dd><p>Get the weighted CSM using this CSM ratio function applied to the data.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>data</strong> – List of CSM values to estimate the weighted CSM.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Weighted CSM from this ratio function.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.CSMFiniteRatioFunction.power2_decreasing_exp">
<span class="sig-name descname"><span class="pre">power2_decreasing_exp</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">vals</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/func_utils.py#L238-L250"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMFiniteRatioFunction.power2_decreasing_exp" title="Link to this definition"></a></dt>
<dd><p>Get the evaluation of the ratio function f(x)=exp(-a*x)*(x-1)^2.</p>
<p>The CSM values (i.e. “x”), are scaled to the “max_csm” parameter. The “a” constant
correspond to the “alpha” parameter.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>vals</strong> – CSM values for which the ratio function has to be evaluated.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Result of the ratio function applied to the CSM values.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.CSMFiniteRatioFunction.ratios">
<span class="sig-name descname"><span class="pre">ratios</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/func_utils.py#L286-L300"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMFiniteRatioFunction.ratios" title="Link to this definition"></a></dt>
<dd><p>Get the fractions from the CSM ratio function applied to the data.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>data</strong> – List of CSM values to estimate fractions.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Corresponding fractions for each CSM.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.CSMFiniteRatioFunction.smootherstep">
<span class="sig-name descname"><span class="pre">smootherstep</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">vals</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/func_utils.py#L252-L267"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMFiniteRatioFunction.smootherstep" title="Link to this definition"></a></dt>
<dd><p>Get the evaluation of the smootherstep ratio function: f(x)=6*x^5-15*x^4+10*x^3.</p>
<p>The CSM values (i.e. “x”), are scaled between the “lower_csm” and “upper_csm” parameters.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>vals</strong> – CSM values for which the ratio function has to be evaluated.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Result of the ratio function applied to the CSM values.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.CSMFiniteRatioFunction.smoothstep">
<span class="sig-name descname"><span class="pre">smoothstep</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">vals</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/func_utils.py#L269-L284"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMFiniteRatioFunction.smoothstep" title="Link to this definition"></a></dt>
<dd><p>Get the evaluation of the smoothstep ratio function: f(x)=3*x^2-2*x^3.</p>
<p>The CSM values (i.e. “x”), are scaled between the “lower_csm” and “upper_csm” parameters.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>vals</strong> – CSM values for which the ratio function has to be evaluated.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Result of the ratio function applied to the CSM values.</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.CSMInfiniteRatioFunction">
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">CSMInfiniteRatioFunction</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">function</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">options_dict</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/func_utils.py#L323-L409"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMInfiniteRatioFunction" title="Link to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.AbstractRatioFunction" title="pymatgen.analysis.chemenv.utils.func_utils.AbstractRatioFunction"><code class="xref py py-class docutils literal notranslate"><span class="pre">AbstractRatioFunction</span></code></a></p>
<p>Concrete implementation of a series of ratio functions applied to the continuous symmetry measure (CSM).</p>
<p>Uses “infinite” ratio functions.</p>
<p>See the following reference for details:
ChemEnv: a fast and robust coordination environment identification tool,
D. Waroquiers et al., Acta Cryst. B 76, 683 (2020).</p>
<p>Constructor for AbstractRatioFunction.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>function</strong> – Ration function name.</p></li>
<li><p><strong>options_dict</strong> – Dictionary containing the parameters for the ratio function.</p></li>
</ul>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.CSMInfiniteRatioFunction.ALLOWED_FUNCTIONS">
<span class="sig-name descname"><span class="pre">ALLOWED_FUNCTIONS</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">ClassVar</span></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">{'power2_inverse_decreasing':</span> <span class="pre">['max_csm'],</span> <span class="pre">'power2_inverse_power2_decreasing':</span> <span class="pre">['max_csm']}</span></em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/chemenv/utils/func_utils.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMInfiniteRatioFunction.ALLOWED_FUNCTIONS" title="Link to this definition"></a></dt>
<dd></dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.CSMInfiniteRatioFunction.fractions">
<span class="sig-name descname"><span class="pre">fractions</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/func_utils.py#L366-L389"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMInfiniteRatioFunction.fractions" title="Link to this definition"></a></dt>
<dd><p>Get the fractions from the CSM ratio function applied to the data.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>data</strong> – List of CSM values to estimate fractions.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Corresponding fractions for each CSM.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.CSMInfiniteRatioFunction.mean_estimator">
<span class="sig-name descname"><span class="pre">mean_estimator</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/func_utils.py#L391-L407"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMInfiniteRatioFunction.mean_estimator" title="Link to this definition"></a></dt>
<dd><p>Get the weighted CSM using this CSM ratio function applied to the data.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>data</strong> – List of CSM values to estimate the weighted CSM.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Weighted CSM from this ratio function.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.CSMInfiniteRatioFunction.power2_inverse_decreasing">
<span class="sig-name descname"><span class="pre">power2_inverse_decreasing</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">vals</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/func_utils.py#L338-L350"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMInfiniteRatioFunction.power2_inverse_decreasing" title="Link to this definition"></a></dt>
<dd><p>Get the evaluation of the ratio function f(x)=(x-1)^2 / x.</p>
<p>The CSM values (i.e. “x”), are scaled to the “max_csm” parameter. The “a” constant
correspond to the “alpha” parameter.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>vals</strong> – CSM values for which the ratio function has to be evaluated.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Result of the ratio function applied to the CSM values.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.CSMInfiniteRatioFunction.power2_inverse_power2_decreasing">
<span class="sig-name descname"><span class="pre">power2_inverse_power2_decreasing</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">vals</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/func_utils.py#L352-L364"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMInfiniteRatioFunction.power2_inverse_power2_decreasing" title="Link to this definition"></a></dt>
<dd><p>Get the evaluation of the ratio function f(x)=(x-1)^2 / x^2.</p>
<p>The CSM values (i.e. “x”), are scaled to the “max_csm” parameter. The “a” constant
correspond to the “alpha” parameter.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>vals</strong> – CSM values for which the ratio function has to be evaluated.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Result of the ratio function applied to the CSM values.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.CSMInfiniteRatioFunction.ratios">
<span class="sig-name descname"><span class="pre">ratios</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/func_utils.py#L366-L389"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.CSMInfiniteRatioFunction.ratios" title="Link to this definition"></a></dt>
<dd><p>Get the fractions from the CSM ratio function applied to the data.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>data</strong> – List of CSM values to estimate fractions.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Corresponding fractions for each CSM.</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.DeltaCSMRatioFunction">
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">DeltaCSMRatioFunction</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">function</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">options_dict</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/func_utils.py#L412-L437"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.DeltaCSMRatioFunction" title="Link to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.AbstractRatioFunction" title="pymatgen.analysis.chemenv.utils.func_utils.AbstractRatioFunction"><code class="xref py py-class docutils literal notranslate"><span class="pre">AbstractRatioFunction</span></code></a></p>
<p>Concrete implementation of a series of ratio functions applied to differences of
continuous symmetry measures (DeltaCSM).</p>
<p>Uses “finite” ratio functions.</p>
<p>See the following reference for details:
ChemEnv: a fast and robust coordination environment identification tool,
D. Waroquiers et al., Acta Cryst. B 76, 683 (2020).</p>
<p>Constructor for AbstractRatioFunction.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>function</strong> – Ration function name.</p></li>
<li><p><strong>options_dict</strong> – Dictionary containing the parameters for the ratio function.</p></li>
</ul>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.DeltaCSMRatioFunction.ALLOWED_FUNCTIONS">
<span class="sig-name descname"><span class="pre">ALLOWED_FUNCTIONS</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">ClassVar</span></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">{'smootherstep':</span> <span class="pre">['delta_csm_min',</span> <span class="pre">'delta_csm_max']}</span></em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/chemenv/utils/func_utils.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.DeltaCSMRatioFunction.ALLOWED_FUNCTIONS" title="Link to this definition"></a></dt>
<dd></dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.DeltaCSMRatioFunction.smootherstep">
<span class="sig-name descname"><span class="pre">smootherstep</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">vals</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/func_utils.py#L426-L437"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.DeltaCSMRatioFunction.smootherstep" title="Link to this definition"></a></dt>
<dd><p>Get the evaluation of the smootherstep ratio function: f(x)=6*x^5-15*x^4+10*x^3.</p>
<p>The DeltaCSM values (i.e. “x”), are scaled between the “delta_csm_min” and “delta_csm_max” parameters.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>vals</strong> – DeltaCSM values for which the ratio function has to be evaluated.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Result of the ratio function applied to the DeltaCSM values.</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.RatioFunction">
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">RatioFunction</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">function</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">options_dict</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/func_utils.py#L116-L219"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.RatioFunction" title="Link to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#pymatgen.analysis.chemenv.utils.func_utils.AbstractRatioFunction" title="pymatgen.analysis.chemenv.utils.func_utils.AbstractRatioFunction"><code class="xref py py-class docutils literal notranslate"><span class="pre">AbstractRatioFunction</span></code></a></p>
<p>Concrete implementation of a series of ratio functions.</p>
<p>Constructor for AbstractRatioFunction.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>function</strong> – Ration function name.</p></li>
<li><p><strong>options_dict</strong> – Dictionary containing the parameters for the ratio function.</p></li>
</ul>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.RatioFunction.ALLOWED_FUNCTIONS">
<span class="sig-name descname"><span class="pre">ALLOWED_FUNCTIONS</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">ClassVar</span></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">{'inverse_smootherstep':</span> <span class="pre">['lower',</span> <span class="pre">'upper'],</span> <span class="pre">'inverse_smoothstep':</span> <span class="pre">['lower',</span> <span class="pre">'upper'],</span> <span class="pre">'power2_decreasing_exp':</span> <span class="pre">['max',</span> <span class="pre">'alpha'],</span> <span class="pre">'power2_inverse_decreasing':</span> <span class="pre">['max'],</span> <span class="pre">'power2_inverse_power2_decreasing':</span> <span class="pre">['max'],</span> <span class="pre">'smootherstep':</span> <span class="pre">['lower',</span> <span class="pre">'upper'],</span> <span class="pre">'smoothstep':</span> <span class="pre">['lower',</span> <span class="pre">'upper']}</span></em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/chemenv/utils/func_utils.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.RatioFunction.ALLOWED_FUNCTIONS" title="Link to this definition"></a></dt>
<dd></dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.RatioFunction.inverse_smootherstep">
<span class="sig-name descname"><span class="pre">inverse_smootherstep</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">vals</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/func_utils.py#L169-L180"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.RatioFunction.inverse_smootherstep" title="Link to this definition"></a></dt>
<dd><p>Get the evaluation of the “inverse” smootherstep ratio function: f(x)=1-(6*x^5-15*x^4+10*x^3).</p>
<p>The values (i.e. “x”), are scaled between the “lower” and “upper” parameters.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>vals</strong> – Values for which the ratio function has to be evaluated.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Result of the ratio function applied to the values.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.RatioFunction.inverse_smoothstep">
<span class="sig-name descname"><span class="pre">inverse_smoothstep</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">vals</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/func_utils.py#L182-L193"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.RatioFunction.inverse_smoothstep" title="Link to this definition"></a></dt>
<dd><p>Get the evaluation of the “inverse” smoothstep ratio function: f(x)=1-(3*x^2-2*x^3).</p>
<p>The values (i.e. “x”), are scaled between the “lower” and “upper” parameters.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>vals</strong> – Values for which the ratio function has to be evaluated.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Result of the ratio function applied to the values.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.RatioFunction.power2_decreasing_exp">
<span class="sig-name descname"><span class="pre">power2_decreasing_exp</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">vals</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/func_utils.py#L129-L141"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.RatioFunction.power2_decreasing_exp" title="Link to this definition"></a></dt>
<dd><p>Get the evaluation of the ratio function f(x)=exp(-a*x)*(x-1)^2.</p>
<p>The values (i.e. “x”), are scaled to the “max” parameter. The “a” constant
correspond to the “alpha” parameter.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>vals</strong> – Values for which the ratio function has to be evaluated.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Result of the ratio function applied to the values.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.RatioFunction.power2_inverse_decreasing">
<span class="sig-name descname"><span class="pre">power2_inverse_decreasing</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">vals</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/func_utils.py#L195-L206"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.RatioFunction.power2_inverse_decreasing" title="Link to this definition"></a></dt>
<dd><p>Get the evaluation of the ratio function f(x)=(x-1)^2 / x.</p>
<p>The values (i.e. “x”), are scaled to the “max” parameter.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>vals</strong> – Values for which the ratio function has to be evaluated.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Result of the ratio function applied to the values.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.RatioFunction.power2_inverse_power2_decreasing">
<span class="sig-name descname"><span class="pre">power2_inverse_power2_decreasing</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">vals</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/func_utils.py#L208-L219"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.RatioFunction.power2_inverse_power2_decreasing" title="Link to this definition"></a></dt>
<dd><p>Get the evaluation of the ratio function f(x)=(x-1)^2 / x^2.</p>
<p>The values (i.e. “x”), are scaled to the “max” parameter.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>vals</strong> – Values for which the ratio function has to be evaluated.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Result of the ratio function applied to the values.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.RatioFunction.smootherstep">
<span class="sig-name descname"><span class="pre">smootherstep</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">vals</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/func_utils.py#L143-L154"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.RatioFunction.smootherstep" title="Link to this definition"></a></dt>
<dd><p>Get the evaluation of the smootherstep ratio function: f(x)=6*x^5-15*x^4+10*x^3.</p>
<p>The values (i.e. “x”), are scaled between the “lower” and “upper” parameters.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>vals</strong> – Values for which the ratio function has to be evaluated.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Result of the ratio function applied to the values.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.func_utils.RatioFunction.smoothstep">
<span class="sig-name descname"><span class="pre">smoothstep</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">vals</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/func_utils.py#L156-L167"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.func_utils.RatioFunction.smoothstep" title="Link to this definition"></a></dt>
<dd><p>Get the evaluation of the smoothstep ratio function: f(x)=3*x^2-2*x^3.</p>
<p>The values (i.e. “x”), are scaled between the “lower” and “upper” parameters.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>vals</strong> – Values for which the ratio function has to be evaluated.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Result of the ratio function applied to the values.</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

</section>
<section id="module-pymatgen.analysis.chemenv.utils.graph_utils">
<span id="pymatgen-analysis-chemenv-utils-graph-utils-module"></span><h2>pymatgen.analysis.chemenv.utils.graph_utils module<a class="headerlink" href="#module-pymatgen.analysis.chemenv.utils.graph_utils" title="Link to this heading"></a></h2>
<p>This module contains some graph utils that are used in the chemenv package.</p>
<dl class="py class">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.graph_utils.MultiGraphCycle">
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">MultiGraphCycle</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">nodes</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">edge_indices</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">validate</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ordered</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/graph_utils.py#L312-L467"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.graph_utils.MultiGraphCycle" title="Link to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">MSONable</span></code></p>
<p>Describe a cycle in a multigraph.</p>
<p>nodes are the nodes of the cycle and edge_indices are the indices of the edges in the cycle.
The nth index in edge_indices corresponds to the edge index between the nth node in nodes and
the (n+1)th node in nodes with the exception of the last one being the edge index between
the last node in nodes and the first node in nodes</p>
<dl class="simple">
<dt>Example: A cycle</dt><dd><p>nodes:          1 - 3 - 4 - 0 - 2 - (1)
edge_indices:     0 . 1 . 0 . 2 . 0 . (0)</p>
</dd>
</dl>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>nodes</strong> – List of nodes in the cycle.</p></li>
<li><p><strong>edge_indices</strong> – List of edge indices in the cycle.</p></li>
<li><p><strong>validate</strong> – If True, will validate the cycle.</p></li>
<li><p><strong>ordered</strong> – If True, will order the cycle.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.graph_utils.MultiGraphCycle.order">
<span class="sig-name descname"><span class="pre">order</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">raise_on_fail</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/graph_utils.py#L390-L444"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.graph_utils.MultiGraphCycle.order" title="Link to this definition"></a></dt>
<dd><p>Orders the SimpleGraphCycle.</p>
<p>The ordering is performed such that the first node is the “lowest” one
and the second node is the lowest one of the two neighbor nodes of the
first node. If raise_on_fail is set to True a RuntimeError will be
raised if the ordering fails.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>raise_on_fail</strong> – If set to True, will raise a RuntimeError if the ordering fails.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.graph_utils.MultiGraphCycle.validate">
<span class="sig-name descname"><span class="pre">validate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">check_strict_ordering</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/graph_utils.py#L381-L388"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.graph_utils.MultiGraphCycle.validate" title="Link to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>check_strict_ordering</strong></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.graph_utils.SimpleGraphCycle">
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">SimpleGraphCycle</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">nodes</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">validate</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ordered</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/graph_utils.py#L130-L309"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.graph_utils.SimpleGraphCycle" title="Link to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">MSONable</span></code></p>
<p>Describe a cycle in a simple graph (graph without multiple edges).</p>
<p>Note that the convention used here is the networkx convention for which simple graphs allow
to have self-loops in a simple graph.
No simple graph cycle with two nodes is possible in a simple graph. The graph will not
be validated if validate is set to False.
By default, the “ordered” parameter is None, in which case the SimpleGraphCycle will be ordered.
If the user explicitly sets ordered to False, the SimpleGraphCycle will not be ordered.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>nodes</strong></p></li>
<li><p><strong>validate</strong></p></li>
<li><p><strong>ordered</strong></p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.graph_utils.SimpleGraphCycle.as_dict">
<span class="sig-name descname"><span class="pre">as_dict</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">dict</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/graph_utils.py#L294-L299"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.graph_utils.SimpleGraphCycle.as_dict" title="Link to this definition"></a></dt>
<dd><p>MSONable dict.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.graph_utils.SimpleGraphCycle.from_dict">
<em class="property"><span class="k"><span class="pre">classmethod</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">from_dict</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dct</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">dict</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">validate</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Self</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/graph_utils.py#L301-L309"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.graph_utils.SimpleGraphCycle.from_dict" title="Link to this definition"></a></dt>
<dd><p>Serialize from dict.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>dct</strong> (<em>dict</em>) – Dict representation.</p></li>
<li><p><strong>validate</strong> – If True, will validate the cycle.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.graph_utils.SimpleGraphCycle.from_edges">
<em class="property"><span class="k"><span class="pre">classmethod</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">from_edges</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">edges</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">edges_are_ordered</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Self</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/graph_utils.py#L260-L292"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.graph_utils.SimpleGraphCycle.from_edges" title="Link to this definition"></a></dt>
<dd><p>Construct SimpleGraphCycle from a list edges.</p>
<p>By default, the edges list is supposed to be ordered as it will be
much faster to construct the cycle. If edges_are_ordered is set to
False, the code will automatically try to find the corresponding edge
order in the list.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.graph_utils.SimpleGraphCycle.order">
<span class="sig-name descname"><span class="pre">order</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">raise_on_fail</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/graph_utils.py#L199-L240"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.graph_utils.SimpleGraphCycle.order" title="Link to this definition"></a></dt>
<dd><p>Orders the SimpleGraphCycle.</p>
<p>The ordering is performed such that the first node is the “lowest” one and the
second node is the lowest one of the two neighbor nodes of the first node. If
raise_on_fail is set to True a RuntimeError will be raised if the ordering fails.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>raise_on_fail</strong> (<em>bool</em>) – If set to True, will raise a RuntimeError if the ordering fails.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.graph_utils.SimpleGraphCycle.validate">
<span class="sig-name descname"><span class="pre">validate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">check_strict_ordering</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/graph_utils.py#L190-L197"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.graph_utils.SimpleGraphCycle.validate" title="Link to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>check_strict_ordering</strong></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.graph_utils.get_all_elementary_cycles">
<span class="sig-name descname"><span class="pre">get_all_elementary_cycles</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">graph</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/graph_utils.py#L470-L515"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.graph_utils.get_all_elementary_cycles" title="Link to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>graph</strong></p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.graph_utils.get_all_simple_paths_edges">
<span class="sig-name descname"><span class="pre">get_all_simple_paths_edges</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">graph</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">source</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">target</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cutoff</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/graph_utils.py#L34-L77"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.graph_utils.get_all_simple_paths_edges" title="Link to this definition"></a></dt>
<dd><p>Get all the simple path and edges.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>graph</strong></p></li>
<li><p><strong>source</strong></p></li>
<li><p><strong>target</strong></p></li>
<li><p><strong>cutoff</strong></p></li>
<li><p><strong>data</strong></p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.graph_utils.get_delta">
<span class="sig-name descname"><span class="pre">get_delta</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">node1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">node2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">edge_data</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/graph_utils.py#L19-L31"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.graph_utils.get_delta" title="Link to this definition"></a></dt>
<dd><p>Get the delta.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>node1</strong></p></li>
<li><p><strong>node2</strong></p></li>
<li><p><strong>edge_data</strong></p></li>
</ul>
</dd>
</dl>
</dd></dl>

</section>
<section id="module-pymatgen.analysis.chemenv.utils.math_utils">
<span id="pymatgen-analysis-chemenv-utils-math-utils-module"></span><h2>pymatgen.analysis.chemenv.utils.math_utils module<a class="headerlink" href="#module-pymatgen.analysis.chemenv.utils.math_utils" title="Link to this heading"></a></h2>
<p>This module contains some math utils that are used in the chemenv package.</p>
<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.math_utils.cosinus_step">
<span class="sig-name descname"><span class="pre">cosinus_step</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xx</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">edges</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">inverse</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/math_utils.py#L205-L218"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.math_utils.cosinus_step" title="Link to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xx</strong></p></li>
<li><p><strong>edges</strong></p></li>
<li><p><strong>inverse</strong></p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.math_utils.divisors">
<span class="sig-name descname"><span class="pre">divisors</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/math_utils.py#L83-L98"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.math_utils.divisors" title="Link to this definition"></a></dt>
<dd><p>From a given natural integer, returns the list of divisors in ascending order.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>n</strong> – Natural integer</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>List of divisors of n in ascending order.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.math_utils.get_center_of_arc">
<span class="sig-name descname"><span class="pre">get_center_of_arc</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">p1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">radius</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/math_utils.py#L101-L117"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.math_utils.get_center_of_arc" title="Link to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>p1</strong></p></li>
<li><p><strong>p2</strong></p></li>
<li><p><strong>radius</strong></p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.math_utils.get_linearly_independent_vectors">
<span class="sig-name descname"><span class="pre">get_linearly_independent_vectors</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">vectors</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span><span class="p"><span class="pre">[</span></span><span class="pre">ArrayLike</span><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">list</span><span class="p"><span class="pre">[</span></span><span class="pre">np.ndarray</span><span class="p"><span class="pre">]</span></span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/math_utils.py#L120-L140"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.math_utils.get_linearly_independent_vectors" title="Link to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>vectors</strong> (<em>list</em><em>[</em><em>ArrayLike</em><em>]</em>) – List of vectors.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.math_utils.normal_cdf_step">
<span class="sig-name descname"><span class="pre">normal_cdf_step</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xx</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mean</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">scale</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/math_utils.py#L156-L163"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.math_utils.normal_cdf_step" title="Link to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xx</strong></p></li>
<li><p><strong>mean</strong></p></li>
<li><p><strong>scale</strong></p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.math_utils.power2_decreasing_exp">
<span class="sig-name descname"><span class="pre">power2_decreasing_exp</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xx</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">edges</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">alpha</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1.0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/math_utils.py#L288-L299"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.math_utils.power2_decreasing_exp" title="Link to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xx</strong></p></li>
<li><p><strong>edges</strong></p></li>
<li><p><strong>alpha</strong></p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.math_utils.power2_inverse_decreasing">
<span class="sig-name descname"><span class="pre">power2_inverse_decreasing</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xx</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">edges</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">prefactor</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/math_utils.py#L322-L334"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.math_utils.power2_inverse_decreasing" title="Link to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xx</strong></p></li>
<li><p><strong>edges</strong></p></li>
<li><p><strong>prefactor</strong></p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.math_utils.power2_inverse_power2_decreasing">
<span class="sig-name descname"><span class="pre">power2_inverse_power2_decreasing</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xx</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">edges</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">prefactor</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/math_utils.py#L337-L352"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.math_utils.power2_inverse_power2_decreasing" title="Link to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xx</strong></p></li>
<li><p><strong>edges</strong></p></li>
<li><p><strong>prefactor</strong></p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.math_utils.power2_inverse_powern_decreasing">
<span class="sig-name descname"><span class="pre">power2_inverse_powern_decreasing</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xx</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">edges</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">prefactor</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">powern</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">2.0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/math_utils.py#L355-L368"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.math_utils.power2_inverse_powern_decreasing" title="Link to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xx</strong></p></li>
<li><p><strong>edges</strong></p></li>
<li><p><strong>prefactor</strong></p></li>
<li><p><strong>powern</strong></p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.math_utils.power2_tangent_decreasing">
<span class="sig-name descname"><span class="pre">power2_tangent_decreasing</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xx</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">edges</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">prefactor</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/math_utils.py#L307-L319"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.math_utils.power2_tangent_decreasing" title="Link to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xx</strong></p></li>
<li><p><strong>edges</strong></p></li>
<li><p><strong>prefactor</strong></p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.math_utils.power3_step">
<span class="sig-name descname"><span class="pre">power3_step</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xx</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">edges</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">inverse</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/math_utils.py#L221-L228"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.math_utils.power3_step" title="Link to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xx</strong></p></li>
<li><p><strong>edges</strong></p></li>
<li><p><strong>inverse</strong></p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.math_utils.powern_decreasing">
<span class="sig-name descname"><span class="pre">powern_decreasing</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xx</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">edges</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">nn</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">2</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/math_utils.py#L274-L285"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.math_utils.powern_decreasing" title="Link to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xx</strong></p></li>
<li><p><strong>edges</strong></p></li>
<li><p><strong>nn</strong></p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.math_utils.powern_parts_step">
<span class="sig-name descname"><span class="pre">powern_parts_step</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xx</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">edges</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">inverse</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">nn</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">2</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/math_utils.py#L231-L266"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.math_utils.powern_parts_step" title="Link to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xx</strong></p></li>
<li><p><strong>edges</strong></p></li>
<li><p><strong>inverse</strong></p></li>
<li><p><strong>nn</strong></p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.math_utils.prime_factors">
<span class="sig-name descname"><span class="pre">prime_factors</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">list</span><span class="p"><span class="pre">[</span></span><span class="pre">int</span><span class="p"><span class="pre">]</span></span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/math_utils.py#L48-L64"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.math_utils.prime_factors" title="Link to this definition"></a></dt>
<dd><p>Lists prime factors of a given natural integer, from greatest to smallest.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>n</strong> – Natural integer</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>list of all prime factors of the given natural n.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.math_utils.scale_and_clamp">
<span class="sig-name descname"><span class="pre">scale_and_clamp</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xx</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">edge0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">edge1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">clamp0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">clamp1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/math_utils.py#L143-L152"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.math_utils.scale_and_clamp" title="Link to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xx</strong></p></li>
<li><p><strong>edge0</strong></p></li>
<li><p><strong>edge1</strong></p></li>
<li><p><strong>clamp0</strong></p></li>
<li><p><strong>clamp1</strong></p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.math_utils.smootherstep">
<span class="sig-name descname"><span class="pre">smootherstep</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xx</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">edges</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">inverse</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/math_utils.py#L189-L202"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.math_utils.smootherstep" title="Link to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xx</strong></p></li>
<li><p><strong>edges</strong></p></li>
<li><p><strong>inverse</strong></p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.math_utils.smoothstep">
<span class="sig-name descname"><span class="pre">smoothstep</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">xx</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">edges</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">inverse</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/math_utils.py#L173-L186"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.math_utils.smoothstep" title="Link to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xx</strong></p></li>
<li><p><strong>edges</strong></p></li>
<li><p><strong>inverse</strong></p></li>
</ul>
</dd>
</dl>
</dd></dl>

</section>
<section id="module-pymatgen.analysis.chemenv.utils.scripts_utils">
<span id="pymatgen-analysis-chemenv-utils-scripts-utils-module"></span><h2>pymatgen.analysis.chemenv.utils.scripts_utils module<a class="headerlink" href="#module-pymatgen.analysis.chemenv.utils.scripts_utils" title="Link to this heading"></a></h2>
<p>This module contains some script utils that are used in the chemenv package.</p>
<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.scripts_utils.compute_environments">
<span class="sig-name descname"><span class="pre">compute_environments</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">chemenv_configuration</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/scripts_utils.py#L195-L394"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.scripts_utils.compute_environments" title="Link to this definition"></a></dt>
<dd><p>Compute the environments.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>chemenv_configuration</strong></p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.scripts_utils.draw_cg">
<span class="sig-name descname"><span class="pre">draw_cg</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">vis</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">site</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">neighbors</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cg</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">perm</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">perfect2local_map</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_perfect</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">csm_info</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">symmetry_measure_type</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'csm_wcs_ctwcc'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">perfect_radius</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_distorted</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">faces_color_override</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/scripts_utils.py#L54-L155"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.scripts_utils.draw_cg" title="Link to this definition"></a></dt>
<dd><p>Draw cg.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>site</strong></p></li>
<li><p><strong>vis</strong></p></li>
<li><p><strong>neighbors</strong></p></li>
<li><p><strong>cg</strong></p></li>
<li><p><strong>perm</strong></p></li>
<li><p><strong>perfect2local_map</strong></p></li>
<li><p><strong>show_perfect</strong></p></li>
<li><p><strong>csm_info</strong></p></li>
<li><p><strong>symmetry_measure_type</strong></p></li>
<li><p><strong>perfect_radius</strong></p></li>
<li><p><strong>show_distorted</strong></p></li>
<li><p><strong>faces_color_override</strong></p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.chemenv.utils.scripts_utils.visualize">
<span class="sig-name descname"><span class="pre">visualize</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cg</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">zoom</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">vis</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">factor</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1.0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">view_index</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">faces_color_override</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/chemenv/utils/scripts_utils.py#L158-L192"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.chemenv.utils.scripts_utils.visualize" title="Link to this definition"></a></dt>
<dd><p>Visualizing a coordination geometry
:param cg:
:param zoom:
:param vis:
:param factor:
:param view_index:
:param faces_color_override:</p>
</dd></dl>

</section>
</section>


           </div>
          </div>
          <footer>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2011, Pymatgen Development Team.</p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>
